#include <linux/pinctrl/machine.h>

#include "virt_pinctrl_dev.h"


static void virtual_pinctrl_dev_release(struct device *dev)
{

}


static struct virt_pinctrl_plat_data_s virt_pinctrl_data =
{
};

static struct platform_device virt_pinctrl_platform_device = {
	.name = "virt_pinctrl_dev",
	.id = -1,
	.dev = {
		/*.platform_data = &virt_gpio_data,*/
		.release = virtual_pinctrl_dev_release,
	}
};
	
static const struct pinctrl_map board_virt001_pinctrl_map[] = {

	PIN_MAP_MUX_GROUP_DEFAULT("virt_spi.0", "virt_pinctrl_dev", "spi0_group", "spi0_func"),
};


static int __init virtual_pinctrl_platform_init(void)
{
	int ret = 0;

	ret = platform_device_register(&virt_pinctrl_platform_device);

	pinctrl_register_mappings(board_virt001_pinctrl_map,
				  ARRAY_SIZE(board_virt001_pinctrl_map));

	return ret;
}
static void __exit virtual_pinctrl_platform_exit(void)
{
    printk("%s:%d\n", __FUNCTION__, __LINE__);
    platform_device_unregister(&virt_pinctrl_platform_device);
}
module_init(virtual_pinctrl_platform_init);
module_exit(virtual_pinctrl_platform_exit);
MODULE_DESCRIPTION("Virtual Pinctrl Controller Platform Device");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("jerry_chg");
